import { userRequest } from './request'

export const userLogin = params => {
  return userRequest.post('/login', { ...params, permission: '1' })
}

export const userRegist = params => {
  return userRequest.post('/register', params)
}

export const userGetBookList = params => {
  return userRequest.get('/book/getListByPage', {
    params
  })
}

export const userBorrowBook = params => {
  return userRequest.post(
    '/user/borrowBook',
    {},
    {
      params
    }
  )
}

export const userReturnBook = params => {
  return userRequest.post(
    '/user/returnBook',
    {},
    {
      params
    }
  )
}

export const getBorrowList = params => {
  return userRequest.get('/user/getBorrowBook', {
    params
  })
}

export const getNotice = () => {
  return userRequest.get('/user/getNotice')
}

export const retrunById = params => {
  return userRequest.post('/user/returnBookById', {},{params})
}

export const upSelfInfo = params => {
  return userRequest.post('/user/updateUserById', params)
}
